package com.gs.spring.core.domain;

import java.util.Collection;

public class Patient {
	public Patient(Long id, Person person, String code) {
		this.id =id;
		this.person = person;
		this.code = code;
	}
	
	public Patient() {
	}

	private Person person;
	private Collection<Visit> visits;
	private Long id;
	private String code;
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
	public Collection<Visit> getVisits() {
		return visits;
	}
	public void setVisits(Collection<Visit> visits) {
		this.visits = visits;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public int hashCode() {
		int hashCode = 22;
		hashCode += 33 + code.hashCode();
		return hashCode;
	}
	public boolean equals(Object obj) {
		if(obj == this) return true;
		if(!(obj instanceof Patient)){
			return false;
		}
		Patient p = (Patient)obj;
		return p.equals(code);
	}
//	public String toString() {
//		StringBuffer patient = new StringBuffer();
//		patient.append(" First Name = " + getPerson().getFirstName());
//		patient.append(", Last Name = " + getPerson().getLastName());
//		patient.append(", Birth Date = " + getPerson().getBirthDate());
//		return patient.toString();
//	}
}
